let fs = require('fs');
for (let i = 1; i < 101; i++) {
    let fileName = 'files/demo' + i + '.txt';
    let random = Math.round(Math.random() * 100).toString();
    fs.writeFileSync(fileName, random);
}
let totalStr = '';
let arr = [];

for (let j = 1; j < 101; j++) {
    let fileName = 'files/demo' + j + '.txt';
    let buf = fs.readFileSync(fileName);
    totalStr = totalStr + buf.toString();
    arr.push(buf.toString());       //增加新数组
}

console.log(totalStr);